package com.book.dao.impl;

import com.book.dao.BookDetailDao;
import com.book.pojo.Book;
import com.book.pojo.BookDetail;

/**
 * @author Baobodadazz
 */
public class BookDetailDaoImpl extends BaseDao implements BookDetailDao {

    //@Override
    public Book queryBookById(Integer id) {
        String sql = "select `id` , `name` , `author` , `price` , `sales` , `stock` , `img_path` imgPath from t_book where id = ?";
        return queryForOne(Book.class, sql, id);
    }


    @Override
    public BookDetail queryBookDetailById(Integer id) {
        String sql = "select `id` , `ISBN` bookISBN , `intrucduce` , `publisher` , `author` , `page` from `t_book_detail` where id = ?";
        return queryForOne(BookDetail.class, sql, id);
    }
}
